package box.mantianx;

import box.mantianx.config.MyConfiguration;
import box.mantianx.dao.UserMapper;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author starrysky
 * @title: ApplicationMain
 * @projectName spring_ma
 * @description: TODO
 * @date 2021/2/315:34
 */
public class ApplicationMain {
    public static void main(String[] args) {
//        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//        UserMapper userMapper = context.getBean("userMapper", UserMapper.class);
//        userMapper.getUser().stream().forEach(System.out::println);
        ApplicationContext context = new AnnotationConfigApplicationContext(MyConfiguration.class);
        UserMapper userMapper = context.getBean("userMapper2", UserMapper.class);
        userMapper.getUser().stream().forEach(System.out::println);
        System.out.println("======");
//        userMapper.insertUser(102000L,"ggc","pwdd");
        System.out.println("======");
        userMapper.getUser().stream().forEach(System.out::println);
    }
}
